from flask import Flask
from flask.signals import _signals

app = Flask(import_name=__name__)

xxxx = _signals.signal('xxxx')
def func(sender, *args, **kwargs):
    print(sender)

xxxx.connect(func)

@app.route('/x')
def index():
    xxxx.send('12345', k='v')
    return "index"

if __name__ == "__main__":
    app.run()